ProxyMongoFill

 

Returns the MongoDB equivalent as a DataTable object.

To use MongoDB, you need to have ProxyMongoDB.exe program running. (  https://files.autobase.biz/FileDownLoad/FileDownLoad.aspx?Folder=Proxy )

 

object @ProxyMongoFill(int connection_id, string collection_name, string filter, string sort);

 

Parameters

int connection_id : Connection ID

string collection_name : Collection Name

string filter : Filter Sentence (JSON Text)

string sort : Sort Sentence (JSON Text)

 

Return Value

If it succeeds, it returns an object, and if it fails, it returns null.

 

Example

connection_id = @ProxyMongoOpen("mongodb://192.168.1.149", "test");
if(connection_id == 0)
{
   @Message("Error. connection_id == 0");
   return;
}

string text;
@sprintf(text, "{PersonCount:50}");
string sort;
@sprintf(sort, "{_id:1}");

object dt;
dt = @ProxyMongoFill(connection_id, "things", text, sort);
@ProxyMongoClose(connection_id);
if(dt == null)
{
   @MessageBox(@GetLastError(), "MongoFill Error", MB_OK);
   return;
}

int count;
count = @DataTableGetRowCount(dt);

if(count > 0) {
   string data = @DataTableGetRowData(dt, "PersonDate", 0);
   string id = @DataTableGetRowData(dt, "_id", 0);
   @sprintf(text, "Count=%d _id=%s, PersonDate=%s", count, id, data);
   @Message(text);
}
else {
   @sprintf(text, "Count=%d", count);
   @Message(text);
}

@DataGridSetDataTable("DataGrid1", dt);
@DataGridReLoad("DataGrid1");

 

Description : Example of opening and using the test database of the 192.168.1.149 IP

 

Version Information

Supported Version: 10.3.5 or higher

 

Related Helps

@ProxyMongoClose()

@ProxyMongoDeleteMany()

@ProxyMongoDeleteOne()

@ProxyMongoFill()

@ProxyMongoInsert()

@ProxyMongoOpen()

@ProxyMongoUpdateMany()

@ProxyMongoUpdateOne()